#!/bin/bash
set -x
echo "正在创建Label Studio的conda环境..."

# 检查是否已存在conda环境
conda info --envs | grep "labelstudio" > /dev/null
if [ $? -ne 0 ]; then
    echo "创建conda环境..."
    conda create -n labelstudio python=3.9 -y
    conda activate labelstudio
    echo "安装Label Studio..."
    pip install label-studio
    echo "安装Label Studio ML Backend..."
    pip install label-studio-ml
else
    echo "Label Studio conda环境已存在"
    conda activate labelstudio
    echo "安装Label Studio..."
    pip install label-studio
    echo "安装Label Studio ML Backend..."
    pip install label-studio-ml
fi

echo "conda环境准备完成"
read -p "Press [Enter] key to continue..."